package com.jxl.apple.components
{
	import com.bit101.components.PushButton;
	
	import flash.display.Bitmap;
	import flash.display.DisplayObjectContainer;
	
	public class PushButton extends com.bit101.components.PushButton
	{
		[Embed(source="/assets/images/push-button/up.png")]
		private var BackgroundImagePNG:Class;
		
		private var backgroundImage:Bitmap;
		
		public function PushButton(parent:DisplayObjectContainer=null, xpos:Number=0, ypos:Number=0, label:String="", defaultHandler:Function=null)
		{
			super(parent, xpos, ypos, label, defaultHandler);
			
			width 	= 292;
			height	= 47;
		}
		
		protected override function addChildren():void
		{
			super.addChildren();
			
			backgroundImage = new BackgroundImagePNG() as Bitmap;
			addChildAt(backgroundImage, 0);
		}
		
		public override function draw():void
		{
			super.draw();
			
			_back.graphics.clear();
			_face.graphics.clear();
			
			backgroundImage.width = width;
			backgroundImage.height = height;
		}
	}
}